<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="arq" uri="/tld/arquitectura.tld" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="dynamic" uri="/tld/dynamic.tld" %>

<html>
<head>
    <jsp:include page="Head.jsp" />

    <script type="text/javascript" xml:space="preserve">

        window.onload = function()
        {
            checkBrowser();
            document.getElementById('login').focus();
        }

        function login()
        {
            if( validateFields() )
            {
                document.forms[0].submit();
            }
        }

        <arq:validateFields>
            <arq:fieldValidation validationType="required" fieldId="login" fieldAlias="<b><i>Login</i></b>" maxLenght="75" />
            <arq:fieldValidation validationType="required" fieldId="password" fieldAlias="<b><i>Password</i></b>" maxLenght="75" />
        </arq:validateFields>


    </script>
</head>
<body>
<form:form name="frm" id="frm" method="post" action="login.htm" onsubmit="return validateFields()">
    <form:hidden path="url"/>
        <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
        <arq:errors printModel="table" classTable="tablaErrores" visibility="global"/>
        <c:if test="${!empty command.url}">
            <table align="center" width="30%">
                <tr>
                    <td>
                        <h4 style="color:red;">You are not authenticated or your session has expired</h4>
                    </td>
                </tr>
            </table>
        </c:if>
        <table width="30%" align="center">
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td align="right" class="textLogin" >Login</td>
                <td align="left">
                    <form:errors path="login" cssClass="campoError"/>
                    <form:input path="login"  maxlength="50" cssErrorClass="inputError"/>
                </td>
            </tr>
            <tr>
                <td align="right" class="textLogin" >Password</td>
                <td align="left">
                    <form:errors path="password" cssClass="campoError"/>
                    <form:password path="password" cssErrorClass="inputError"/><br/>
                    <img src="images/powered_by_google.gif" alt="Powered by google"/>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
        </table>
        <br/>
        <table width="40%" align="center">
            <tr>
                <td colspan=2 align="center">
                    <dynamic:flashButton text="Login" color="blue" link="login()" height="35" width="160" />
                </td>
            </tr>
        </table>

            <div style="visibility:hidden">
                <input type="submit" name="btnLogin" value="Login" />
            </div>
        <br>
        <br>
        <table align="center">
            <tr>
                <td>
                    <a href="register.htm" style="text-decoration:none;">Sign up for an account</a>
                </td>
            </tr>
            <tr><td>&nbsp;</td></tr>
            <tr><td>&nbsp;</td></tr>
            <tr><td><img src="images/google_balls.jpg" alt="Google"/></td></tr>
        </table>
</form:form>
</body>
</html>